package com.shaw.client.mvc.goal;




import com.extjs.gxt.ui.client.mvc.AppEvent;
import com.extjs.gxt.ui.client.mvc.Controller;

import com.shaw.client.mvc.AppEvents;


public class GoalController extends Controller {

	// private MailView mailView;
	public static String COOKIE_SHORTCUT_MAIL = "xhf-shortcut-mail";

	public static String COOKIE_SHORTCUT_MAIL_NEW = "xhf-shortcut-mail-new";


	public GoalController() {
		// mailView = new MailView(this);
		//
		registerEventTypes(AppEvents.INIT);
		registerEventTypes(AppEvents.GOAL);
	}

	@Override
	public void handleEvent(AppEvent event) {
		if (event.getType() == AppEvents.INIT) {
			//AppMainUI desktop = Registry.get(AppView.DESKTOP);
			//desktop.createCenter();
			//desktop.createNorth();
			//desktop.createWest();
		  //ContentPanel west = Registry.get(AppView.WEST_PANEL); 		
		  //LayoutContainer center = Registry.get(AppView.CENTER_PANEL); 
		 
		 //RootPanel.get().add(desktop);
			 /*	 Shortcut shortcut = new Shortcut();
			 AppIcons appIcons=GWT.create(AppIcons.class);
			shortcut.setIcon(appIcons.mail32());
		
			 shortcut.setText("目标");
			 appui.addShortcut(shortcut);   */
			 
			// List<ShortcutGroup> list=Registry.get(AppView.SHORTCUT_GROUP);
			//			
			// ShortcutGroup group=new ShortcutGroup();
			// group.setName("邮件系统");
			// list.add(group);
			//			
			// MyShortcut shortcut=new MyShortcut();
			// shortcut.setText("邮件系统");
			// shortcut.setIcon(AppView.appIcons.mail32());
			// shortcut.setEvent(AppEvents.MAIL);
			// shortcut.setCookie(COOKIE_SHORTCUT_MAIL);
			// shortcut.setDefaultShow(true);
			//			
			// group.addMyShortcut(shortcut);
			// desktop.addMyShortcut(shortcut, false);
			//			
			// shortcut=new MyShortcut();
			// shortcut.setText("新邮件");
			// shortcut.setIcon(AppView.appIcons.mail32());
			// shortcut.setEvent(AppEvents.MAIL_new);
			// shortcut.setCookie(COOKIE_SHORTCUT_MAIL_NEW);
			// shortcut.setDefaultShow(false);
			//			
			// group.addMyShortcut(shortcut);
			// desktop.addMyShortcut(shortcut, false);
			//			
			//			
			// //子启动
			// AutoRunModel autoRunModel=new AutoRunModel();
			// autoRunModel.setEvent(AppEvents.MAIL);
			// autoRunModel.setName("邮件系统");
			// autoRunModel.setCookieId(COOKIE_AUTORUN_MAIL);
			// AppView.autoRunList.add(autoRunModel);
			//			
			//			
			// StartMenu startMenu=Registry.get(AppView.START_MENU);
			// MenuItem item=new MenuItem("邮件系统");
			// item.setData("event", AppEvents.MAIL);
			// item.addSelectionListener(AppView.startMenuListener);
			//			
			// Menu menu=new Menu();
			// MenuItem newMail=new MenuItem("新邮件");
			// newMail.setData("event", AppEvents.MAIL_new);
			// newMail.addSelectionListener(AppView.startMenuListener);
			// menu.add(newMail);
			// item.setSubMenu(menu);
			//			
			// startMenu.add(item);
			//			
			// //添加portlet
			// PortalView.portletList.add(MailPortlet.get());

		}
		// forwardToView(mailView, event);
	}

}
